function $(id) {
	return document.getElementById(id);
}
var timer;
var n = 1;
function startChange() {
	timer = window.setInterval(repeat, 1000);
}
function repeat() {
	change(n++ % 6, false);
}
function stopChange(x) {
	if (x < 6) {
		n = x + 1;
	}
	window.clearInterval(timer);
}
function change(x, isHandle) {
	if (isHandle) {
		stopChange(x);
	}
	var buttons = $("buttons").getElementsByTagName("div");
	for ( var i = 0; i < buttons.length; i++) {
		buttons[i].className = "style1";
	}
	buttons[x].className = "style2";
	$("image").src = "/res/image/space/" + (1 + x) + ".jpg";
}

function deleteEmail(o) {
	var name = o.name;
	var url = '';
	msg = '确认要删除该 邮件吗';
	if (window.confirm(msg)) {
		url = 'spaceManage.action?id=' + name + '&' + 'act=deleteEmail';
		window.location = url;
	}
}
function detailEmail(o) {
	var name = o.name;
	window.location = window.location = 'spaceManage.action?id=' + name + '&'
			+ 'act=detailEmail';
}
